#ifndef LOOPCOMPUTERANDGETNEXTCOMPUTERDATA_H
#define LOOPCOMPUTERANDGETNEXTCOMPUTERDATA_H

#include "lidarclient.h"

#include <QThread>
#include <QMutex>

//另起线程，循环computer，getNextComputerData
class LoopComputerAndGetNextComputerData : public QThread
{
    Q_OBJECT
public:
    LoopComputerAndGetNextComputerData(QObject *parent = nullptr);

    void SetGuid(const lidar::GUID &guid) { m_guid = guid; }
    void SetDuration(const int duration) { m_duration = duration; }
    void SetClient(QSharedPointer<LidarClient> client ) { m_client = client; }
    void SetMutex(QSharedPointer<QMutex> mutex) {m_mutex = mutex;}

    void run();

public slots:
    void StartThread();
    void StopThread();

private:
    lidar::GUID m_guid;
    int m_duration;
    QSharedPointer<LidarClient> m_client;
    QSharedPointer<QMutex> m_mutex;

    bool m_isRunning;
};

#endif // LOOPCOMPUTERANDGETNEXTCOMPUTERDATA_H
